#ifndef SATURNOS_INC_KERN_KMALLOC_H
#define SATURNOS_INC_KERN_KMALLOC_H

#include <kern/memlayout.h>
#include <kern/mmu.h>
#include <types.h>

// kernel virtual pages
struct kvpg_t {
	struct kvpg_t* next;
};

struct kvpg_t* kvpgs;
int nrkvpgs;
/**
* init free address space array
*/
int kmalloc_init(void);


/**
* map 1 page to an available kernel va.
* @return address of the mapped page or null if out of available va
*/
void* kmalloc(physaddr_t pg);

/**
* free 1 allocated page
*/
void kfree(void* pgaddr);


#endif /* SATURNOS_INC_KERN_KMALLOC_H */

